package com.runyun.project.controller.interceptor;


import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Component
public class LoginInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//        Object loginUser = request.getSession().getAttribute("loginUser");
//        System.out.println("++==========" + loginUser  + request.getSession());
//        if (loginUser==null){
//            //未登录,返回登录页面
//            return false;
//        }else {
//            //已登录,放行
//            return true;
//        }
        return true;
    }
}
